package com.yh.homestay.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class StringConvertDate {
    public Date convert(String fe){
    Date date = null;
        //创建SimpleDateFormat对象实例并定义好转换格式
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        try {
            date = sdf.parse(fe);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }
}
